-
Notifications
You must be signed in to change notification settings - Fork 529
Add support for Cloudflare Images operations in the images binding #5912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
Merging this PR will not alter performance
Comparing Footnotes
|
a721698 to
cb83759
Compare
af8444f to
826c28b
Compare
| ): Promise<ImageMetadata> { | ||
| let processedImage: ReadableStream<Uint8Array> | ArrayBuffer = image; | ||
|
|
||
| if (options?.encoding === 'base64') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not do this on the server side?
Best not to have any code on the client side - we want to remove this file eventually!
Currently the Images Binding only supports
infoandtransformoperations. This PR introduces support for the following Hosted Images endpoints that are already available via the images api:The images binding has recently been switched to a direct binding, so whilst
infoandtransformare still handled byfetcher.fetchthe new endpoints for managing Hosted Images pass through via RPC.Sample implementation
Once released, we'd expect users to be able to write worker code that looks something like
Reviewer Considerations
uploadmethod having having a non trivial implementation (to leverage workerd's base64 decoding support)images-api.tsin its entirety and move the existing transformation logic into our upstream images apienv.IMAGES.hosted.list(). We are hopeful that will more clearly disambiguate their function to users and give us more flexibility on the addition of new methods to the binding in the future.Next Steps